namespace ShortUrl.WebUI.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class InitialCreate : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.UrlLinks",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        ShortKey = c.String(maxLength: 10),
                        UrlLong = c.String(maxLength: 255),
                        CreatedDate = c.DateTime(nullable: false),
                        VisitCount = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id)
                .Index(t => t.ShortKey, unique: true, name: "IX_ShortUrl")
                .Index(t => t.UrlLong, unique: true);
            
        }
        
        public override void Down()
        {
            DropIndex("dbo.UrlLinks", new[] { "UrlLong" });
            DropIndex("dbo.UrlLinks", "IX_ShortUrl");
            DropTable("dbo.UrlLinks");
        }
    }
}
